<template>
  <el-tabs ref="preferentialPackageRef" v-model="activeName" type="card">
    <el-tab-pane v-if="$hasTabPermission(10020401)" label="优惠权益设定" name="legal">
      <legal-tab />
    </el-tab-pane>
    <el-tab-pane v-if="$hasTabPermission(10020402)" label="优惠客户管理" name="client">
      <client-tab />
    </el-tab-pane>
  </el-tabs>
</template>

<script>
  import legalTab from './components/legalTab'
  import clientTab from './components/clientTab'

  export default {
    name: 'preferentialPackage',
    components: {
      legalTab, clientTab
    },
    data() {
      return {
        activeName: 'legal'
      }
    },
    mounted() {
      this.activeName = this.$refs.preferentialPackageRef.panes[0].name
    }
  }
</script>

<style scoped>

</style>
